package com.wyg.adapter;

/**
 * @description:
 * @author: WYG
 * @time: 2021/3/31 9:12
 */

public class TurkeyAdapter implements Duck{
    private Turkey turkey;

    public TurkeyAdapter(Turkey turkey) {
        this.turkey = turkey;
    }

    @Override
    public void quack() {
        turkey.gobble();
    }

    @Override
    public void fly() {
        for (int i = 0; i < 5; i++) {
            turkey.fly();
        }
    }

    public static void main(String[] args) {
        WildTurkey turkey = new WildTurkey();
        TurkeyAdapter adapter = new TurkeyAdapter(turkey);
        adapter.quack();
        adapter.fly();

    }
}
